package models_main

import (
	"fmt"
	"longmen/server/pkg/db/mysql/models"
	"time"
)

type Signin struct {
	ID        int       `json:"id"`
	Stage     int       `json:"stage"`
	Reward    int       `json:"reward"`
	Rank      int       `json:"rank"` // 1-5星 设定高于多少级公告奖励
	Name      string    `json:"name"`
	Quantity  int       `json:"quantity"`
	Thumb     string    `json:"thumb"`
	Type      int32     `json:"type"` //1虚拟直播道具,2实物,3机会次数,4,前进或后退步数
	CreatedAt time.Time `json:"created_at"`
}

func (Signin) TableName() string {
	return fmt.Sprintf("%ssignin", models.Prefix)
}

type SigninStage struct {
	ID        int       `json:"id"`
	UserID    int       `json:"user_id"`
	Stage     int       `json:"stage"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

func (SigninStage) TableName() string {
	return fmt.Sprintf("%ssignin_step", models.Prefix)
}

type SigninHistory struct {
	ID         int       `json:"id"`
	SigninID   int       `json:"signin_id"`
	PropsID    int       `json:"props_id"`
	UserID     int       `json:"user_id"`
	Nickname   string    `json:"nickname"`
	Stage      int       `json:"stage"`
	Name       string    `json:"name"`
	Quantity   int       `json:"quantity"`
	Thumb      string    `json:"thumb"`
	Type       int32     `json:"type"` //1虚拟直播道具,2实物,3机会次数,4,前进或后退步数
	Rank       int32     `json:"rank"`
	MoreChance int32     `json:"more_chance"`
	Platform   int32     `json:"platform"` // 平台来源
	CreatedAt  time.Time `json:"created_at"`
}

func (SigninHistory) TableName() string {
	return fmt.Sprintf("%ssignin_history", models.Prefix)
}
